[XEND] Clean up some keyword clashes with XendCheckpoint
authoracnt2@huggins.lce.cl.cam.ac.uk <acnt2@huggins.lce.cl.cam.ac.uk>
Thu, 5 Oct 2006 16:29:19 +0000 (17:29 +0100)
committeracnt2@huggins.lce.cl.cam.ac.uk <acnt2@huggins.lce.cl.cam.ac.uk>
Thu, 5 Oct 2006 16:29:19 +0000 (17:29 +0100)
- Replaced str with domstr
- Disabled changing domain name while migrating

Signed-off-by: Alastair Tse <atse@xensource.com>
tools/python/xen/xend/XendCheckpoint.py

index 30a9caaf74c425b4d8e5723b51ac254f92c0b772..6d36d0f1b4469496400576eefd38a8045635706e 100644 (file)
@@ -40,13 +40,13 @@ def write_exact(fd, buf, errmsg):
 def read_exact(fd, size, errmsg):
     buf  = '' 
     while size != 0: 
-        str = os.read(fd, size)
-        if not len(str):
+        readstr = os.read(fd, size)
+        if not len(readstr):
             log.error("read_exact: EOF trying to read %d (buf='%s')" % \
                       (size, buf))
             raise XendError(errmsg)
-        size = size - len(str)
-        buf  = buf + str
+        size = size - len(readstr)
+        buf  = buf + readstr
     return buf
 
 
@@ -60,7 +60,9 @@ def save(fd, dominfo, network, live, dst):
     # Rename the domain temporarily, so that we don't get a name clash if this
     # domain is migrating (live or non-live) to the local host.  Doing such a
     # thing is useful for debugging.
-    dominfo.setName('migrating-' + domain_name)
+    #
+    # FIXME: I don't think this is such a good idea - atse@xensource.com
+    #dominfo.setName('migrating-' + domain_name)
 
     try:
         dominfo.migrateDevices(network, dst, DEV_MIGRATE_STEP1, domain_name)
@@ -101,10 +103,10 @@ def save(fd, dominfo, network, live, dst):
     except Exception, exn:
         log.exception("Save failed on domain %s (%d).", domain_name,
                       dominfo.getDomid())
-        try:
-            dominfo.setName(domain_name)
-        except:
-            log.exception("Failed to reset the migrating domain's name")
+        #try:
+        #    dominfo.setName(domain_name)
+        #except:
+        #    log.exception("Failed to reset the migrating domain's name")
         raise Exception, exn